__require = function e(t, n, r) {
  function s(o, u) {
    if (!n[o]) {
      if (!t[o]) {
        var b = o.split("/");
        b = b[b.length - 1];
        if (!t[b]) {
          var a = "function" == typeof __require && __require;
          if (!u && a) return a(b, !0);
          if (i) return i(b, !0);
          throw new Error("Cannot find module '" + o + "'");
        }
      }
      var f = n[o] = {
        exports: {}
      };
      t[o][0].call(f.exports, function(e) {
        var n = t[o][1][e];
        return s(n || e);
      }, f, f.exports, e, t, n, r);
    }
    return n[o].exports;
  }
  var i = "function" == typeof __require && __require;
  for (var o = 0; o < r.length; o++) s(r[o]);
  return s;
}({
  AudioMng: [ function(require, module, exports) {
    (function(global) {
      "use strict";
      cc._RF.push(module, "be3026afQtHt7oUaaOtxl9y", "AudioMng");
      "use strict";
      cc.Class({
        extends: cc.Component,
        properties: {
          musicBg: {
            default: null,
            type: cc.AudioClip
          },
          sBtnClick: {
            default: null,
            type: cc.AudioClip
          },
          sCarDriving: {
            default: null,
            type: cc.AudioClip
          },
          sCreck: {
            default: null,
            type: cc.AudioClip
          },
          sLevelComplete: {
            default: null,
            type: cc.AudioClip
          },
          sPickupCoin: {
            default: null,
            type: cc.AudioClip
          },
          sSlide: {
            default: null,
            type: cc.AudioClip
          },
          sTapSound: {
            default: null,
            type: cc.AudioClip
          },
          sTowelTouch: {
            default: null,
            type: cc.AudioClip
          }
        },
        start: function start() {},
        playBgMusic: function playBgMusic() {
          this.soundOnOff() && (this.current = cc.audioEngine.play(this.musicBg, true));
        },
        stopBgMusic: function stopBgMusic() {
          if (null != this.current) {
            cc.audioEngine.stop(this.current);
            this.current = null;
          }
        },
        playEffect: function playEffect(effect) {
          if (this.soundOnOff()) return cc.audioEngine.play(effect, false);
        },
        playBtnClick: function playBtnClick() {
          this.playEffect(this.sBtnClick);
        },
        playCarDriving: function playCarDriving() {
          this.driving = this.playEffect(this.sCarDriving);
        },
        stopCarDriving: function stopCarDriving() {
          null != this.driving && cc.audioEngine.stop(this.driving);
        },
        playCreck: function playCreck() {
          this.playEffect(this.sCreck);
        },
        playLevelComplete: function playLevelComplete() {
          this.playEffect(this.sLevelComplete);
        },
        playPickupCoin: function playPickupCoin() {
          this.playEffect(this.sPickupCoin);
        },
        playSlide: function playSlide() {
          this.playEffect(this.sSlide);
        },
        playTapSound: function playTapSound() {
          this.playEffect(this.sTapSound);
        },
        playTowelTouch: function playTowelTouch() {
          this.playEffect(this.sTowelTouch);
        },
        turnSoundOnOff: function turnSoundOnOff() {
          cc.sys.localStorage.setItem("KEY_SOUND_ON_OFF", !this.soundOnOff());
        },
        soundOnOff: function soundOnOff() {
          var onOff = cc.sys.localStorage.getItem("KEY_SOUND_ON_OFF");
          onOff = null == onOff || "true" == onOff;
          global.soundOnOff = onOff;
          return onOff;
        }
      });
      cc._RF.pop();
    }).call(this, "undefined" !== typeof global ? global : "undefined" !== typeof self ? self : "undefined" !== typeof window ? window : {});
  }, {} ],
  actorBox: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "921f31AD9dM0LuPI3rNgrZO", "actorBox");
    "use strict";
    var BoxType = {
      TYPE_1: 1,
      TYPE_2: 2,
      TYPE_3: 3,
      TYPE_4: 4
    };
    var area = {
      AREA_1: 1,
      AREA_2: 2
    };
    var collisonResult = {
      NO: 1,
      EAT: 2,
      OVER: 3,
      OUT_SCREEN: 4
    };
    cc.Class({
      extends: cc.Component,
      properties: {
        lineCollisionRadius: 0,
        carCllisionR: 0,
        spImg: {
          default: null,
          type: cc.Sprite
        },
        carCircleFrame1: cc.SpriteFrame,
        carCircleFrame2: cc.SpriteFrame,
        carSquareFrame1: cc.SpriteFrame,
        carSquareFrame2: cc.SpriteFrame
      },
      initData: function initData(params) {
        this.params = params;
        this.boxImg = [ this.carCircleFrame1, this.carSquareFrame1, this.carCircleFrame2, this.carSquareFrame2 ];
        this.box_x = [ 90, 270, 450, 630 ];
      },
      onLoad: function onLoad() {
        this.initBox();
      },
      initBox: function initBox() {
        var Rand_Size = Math.floor(10 * Math.random()) % 2;
        var position_x = 1 == this.params.playerArea ? this.box_x[Rand_Size] : this.box_x[Rand_Size + 2];
        var Rand_Monst1 = Math.floor(10 * Math.random()) % 3;
        var Rand_I = 0 == Rand_Monst1 ? 0 : 1;
        this.box_id = 1 == this.params.playerArea ? Rand_I : Rand_I + 2;
        var img = this.boxImg[this.box_id];
        var f_point = cc.p(position_x, 1300);
        var t_point = cc.p(position_x, -200);
        var tag = 0 == Rand_I ? 102 : 201;
        this.node.setPosition(f_point);
        this.spImg.spriteFrame = img;
        var moveTo = cc.moveTo(3.5, t_point);
        this.node.runAction(moveTo);
      },
      update: function update(dt) {
        var carPoint = 1 == this.params.playerArea ? this.params.car1.node.getPosition() : this.params.car2.node.getPosition();
        var dist = this.node.position.sub(carPoint).mag();
        var isCollisionForCar = dist <= this.carCllisionR;
        if (1 == this.params.playerArea) {
          if (0 == this.box_id) {
            var dist = this.node.position.sub(cc.p(this.node.position.x, this.params.lineY)).mag();
            if (isCollisionForCar) {
              this.params.game.addScore(carPoint);
              this.node.destroy();
            } else if (dist <= this.lineCollisionRadius) {
              this.params.game.gameOver(carPoint);
              this.node.destroy();
            }
          } else if (1 == this.box_id) {
            var dist = this.node.position.sub(cc.p(this.node.position.x, -200)).mag();
            if (isCollisionForCar) {
              this.params.game.gameOver(carPoint);
              this.node.destroy();
            } else dist <= this.lineCollisionRadius && this.node.destroy();
          }
        } else if (2 == this.box_id) {
          var dist = this.node.position.sub(cc.p(this.node.position.x, this.params.lineY)).mag();
          if (isCollisionForCar) {
            this.params.game.addScore(carPoint);
            this.node.destroy();
          } else if (dist <= this.lineCollisionRadius) {
            this.params.game.gameOver(carPoint);
            this.node.destroy();
          }
        } else if (3 == this.box_id) {
          var dist = this.node.position.sub(cc.p(this.node.position.x, -200)).mag();
          if (isCollisionForCar) {
            this.params.game.gameOver(carPoint);
            this.node.destroy();
          } else dist <= this.lineCollisionRadius && this.node.destroy();
        }
      },
      onDestroy: function onDestroy() {
        cc.log("actorBox--onDestroy:" + this.box_id);
      }
    });
    cc._RF.pop();
  }, {} ],
  buttonScaler: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "51237zUloVKp7pONA7AllMG", "buttonScaler");
    "use strict";
    cc.Class({
      extends: cc.Component,
      properties: {
        pressedScale: 1,
        transDuration: 0
      },
      onLoad: function onLoad() {
        var self = this;
        var audioMng = cc.find("sceneGameOver/AudioMng") || cc.find("sceneMenu/AudioMng") || cc.find("scenePlay/AudioMng");
        cc.log("audioMng:" + audioMng);
        audioMng && (audioMng = audioMng.getComponent("AudioMng"));
        self.initScale = this.node.scale;
        self.button = self.getComponent(cc.Button);
        self.scaleDownAction = cc.scaleTo(self.transDuration, self.pressedScale);
        self.scaleUpAction = cc.scaleTo(self.transDuration, self.initScale);
        function onTouchDown(event) {
          this.stopAllActions();
          audioMng && audioMng.playBtnClick();
          this.runAction(self.scaleDownAction);
        }
        function onTouchUp(event) {
          this.stopAllActions();
          this.runAction(self.scaleUpAction);
        }
        this.node.on("touchstart", onTouchDown, this.node);
        this.node.on("touchend", onTouchUp, this.node);
        this.node.on("touchcancel", onTouchUp, this.node);
      }
    });
    cc._RF.pop();
  }, {} ],
  global: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "26837JA6WJB3qimncwTXLga", "global");
    "use strict";
    window.global = {
      soundOnOff: true,
      currentScore: 0,
      getLevelHscore: function getLevelHscore() {
        var hScore = cc.sys.localStorage.getItem("LEVEL_HSCORE_KEY");
        hScore = null == hScore ? 0 : hScore;
        return hScore;
      },
      setLevelHscore: function setLevelHscore(score) {
        cc.sys.localStorage.setItem("LEVEL_HSCORE_KEY", score);
      }
    };
    cc._RF.pop();
  }, {} ],
  sceneGameOver: [ function(require, module, exports) {
    (function(global) {
      "use strict";
      cc._RF.push(module, "66214/i6WtPNLayXGCyR9Qk", "sceneGameOver");
      "use strict";
      cc.Class({
        extends: cc.Component,
        properties: {
          audioMng: cc.Node,
          txtScore: {
            default: null,
            type: cc.Label
          },
          txtBest: {
            default: null,
            type: cc.Label
          }
        },
        onLoad: function onLoad() {
          this.audioMng = this.audioMng.getComponent("AudioMng");
          this.txtScore.string = global.currentScore;
          this.txtBest.string = global.getLevelHscore();
        },
        start: function start() {},
        clickHome: function clickHome() {
          cc.director.loadScene("sceneMenu");
        },
        clickAgain: function clickAgain() {
          cc.director.loadScene("scenePlay");
        },
        onDestroy: function onDestroy() {
          this.audioMng.stopBgMusic();
          cc.log("sceneGameOver---onDestroy");
        }
      });
      cc._RF.pop();
    }).call(this, "undefined" !== typeof global ? global : "undefined" !== typeof self ? self : "undefined" !== typeof window ? window : {});
  }, {} ],
  sceneMenu: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "bdca7A1O0RNyZsfIVjwoJKl", "sceneMenu");
    "use strict";
    cc.Class({
      extends: cc.Component,
      properties: {
        audioMng: cc.Node,
        spSoundOn: cc.SpriteFrame,
        spSoundOff: cc.SpriteFrame,
        btnSound: {
          default: null,
          type: cc.Button
        }
      },
      onLoad: function onLoad() {
        cc.log("sceneMenu---onLoad");
        this.audioMng = this.audioMng.getComponent("AudioMng");
        this.audioMng.playBgMusic();
        cc.director.preloadScene("sceneGameOver", function() {
          cc.log("Next scene preloaded!");
        });
        this.refreshBtnSoundUI();
      },
      start: function start() {
        cc.log("sceneMenu---start");
      },
      update: function update(dt) {},
      lateUpdate: function lateUpdate(dt) {},
      onEnable: function onEnable() {
        cc.log("sceneMenu---onEnable");
      },
      clickPlay: function clickPlay() {
        cc.director.loadScene("scenePlay");
      },
      clickSound: function clickSound() {
        this.audioMng.turnSoundOnOff();
        var soundOnOff = this.audioMng.soundOnOff();
        cc.log("sceneMenu---click  btnSound:" + soundOnOff);
        soundOnOff ? this.audioMng.playBgMusic() : this.audioMng.stopBgMusic();
        this.refreshBtnSoundUI();
      },
      clickStar: function clickStar() {
        cc.log("sceneMenu---click  btnStar");
      },
      clickRank: function clickRank() {
        cc.log("sceneMenu---click  btnRank");
      },
      refreshBtnSoundUI: function refreshBtnSoundUI() {
        if (this.audioMng.soundOnOff()) {
          this.btnSound.normalSprite = this.spSoundOn;
          this.btnSound.pressedSprite = this.spSoundOn;
          this.btnSound.hoverSprite = this.spSoundOn;
        } else {
          this.btnSound.normalSprite = this.spSoundOff;
          this.btnSound.pressedSprite = this.spSoundOff;
          this.btnSound.hoverSprite = this.spSoundOff;
        }
      },
      onDisable: function onDisable() {
        cc.log("sceneMenu---onDisable");
      },
      onDestroy: function onDestroy() {
        this.audioMng.stopBgMusic();
        cc.log("sceneMenu---onDestroy");
      }
    });
    cc._RF.pop();
  }, {} ],
  scenePlay: [ function(require, module, exports) {
    (function(global) {
      "use strict";
      cc._RF.push(module, "4ed03HTXs1E8a2lBxfdVVZw", "scenePlay");
      "use strict";
      var ActorBox = require("actorBox");
      cc.Class({
        extends: cc.Component,
        properties: {
          audioMng: cc.Node,
          boxPrefab: {
            default: null,
            type: cc.Prefab
          },
          layCtrl: {
            default: null,
            type: cc.Layout
          },
          spLineHori: {
            default: null,
            type: cc.Sprite
          },
          spCar1: {
            default: null,
            type: cc.Sprite
          },
          psCar1: {
            default: null,
            type: cc.Node
          },
          spCar2: {
            default: null,
            type: cc.Sprite
          },
          psCar2: {
            default: null,
            type: cc.Node
          },
          txtScore: {
            default: null,
            type: cc.Label
          },
          txtBest: {
            default: null,
            type: cc.Label
          },
          txtTap: {
            default: null,
            type: cc.Node
          },
          spIntro: {
            default: null,
            type: cc.Node
          },
          psCircle: {
            default: null,
            type: cc.Prefab
          },
          psSquare: {
            default: null,
            type: cc.Prefab
          },
          spDotLine11: {
            default: null,
            type: cc.Node
          },
          spDotLine12: {
            default: null,
            type: cc.Node
          },
          spDotLine21: {
            default: null,
            type: cc.Node
          },
          spDotLine22: {
            default: null,
            type: cc.Node
          }
        },
        onLoad: function onLoad() {
          this.audioMng = this.audioMng.getComponent("AudioMng");
          this.audioMng.playBgMusic();
          this.initUI();
          this.initData();
        },
        start: function start() {
          this.layCtrl.node.on(cc.Node.EventType.TOUCH_START, this.onTouchBegin, this);
          this.layCtrl.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
          this.layCtrl.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
        },
        initUI: function initUI() {
          var leve_hScore = global.getLevelHscore();
          this.txtBest.string = leve_hScore;
          var lHoriPosition = this.spLineHori.node.getPosition();
          this.linePointY = lHoriPosition.y;
          this.psCar1.active = false;
          this.psCar2.active = false;
          var carPosition = this.spCar2.node.getPosition();
          this.carPYtop = carPosition.y + this.spCar2.node.getContentSize().height / 2;
          this.carWidth = this.spCar2.node.getContentSize().width;
          this.dotLineHeight = this.spDotLine11.getContentSize().height + 26;
          this.spDotLine11.setPosition(cc.p(180, 0));
          this.spDotLine12.setPosition(cc.p(this.spDotLine11.position.x, this.spDotLine11.position.y + this.dotLineHeight));
          this.spDotLine21.setPosition(cc.p(540, 0));
          this.spDotLine22.setPosition(cc.p(this.spDotLine21.position.x, this.spDotLine21.position.y + this.dotLineHeight));
        },
        initData: function initData() {
          this.IS_RUN = true;
          this.ITEM_STEP = 10;
          this.PYR_1 = 0;
          this.PYR_2 = 0;
          this.Ptouch_1 = true;
          this.Ptouch_2 = true;
          this.IS_GAMEOVER = false;
          this.SCORE_TEMP = 0;
          global.currentScore = this.SCORE_TEMP;
        },
        initRunDotLine: function initRunDotLine(target, params) {
          params.tag.setPosition(cc.p(params.pX, params.startY));
          params.tag.runAction(cc.sequence(cc.moveTo(7, params.pX, params.endY), cc.callFunc(this.initRunDotLine, this, params)));
        },
        runDotLine: function runDotLine() {
          this.spDotLine11.runAction(cc.sequence(cc.moveTo(3.5, 180, -1384), cc.callFunc(this.initRunDotLine, this, {
            tag: this.spDotLine11,
            pX: 180,
            startY: 1410,
            endY: -1384
          })));
          this.initRunDotLine(this, {
            tag: this.spDotLine12,
            pX: 180,
            startY: 1410,
            endY: -1384
          });
          this.spDotLine21.runAction(cc.sequence(cc.moveTo(3.5, 540, -1384), cc.callFunc(this.initRunDotLine, this, {
            tag: this.spDotLine21,
            pX: 540,
            startY: 1410,
            endY: -1384
          })));
          this.initRunDotLine(this, {
            tag: this.spDotLine22,
            pX: 540,
            startY: 1410,
            endY: -1384
          });
        },
        onTouchBegin: function onTouchBegin(event) {
          var point = event.touch.getLocation();
          var that = this;
          if (10 == this.ITEM_STEP) {
            this.ITEM_STEP = 1;
            this.spIntro.runAction(cc.fadeOut(1));
            this.txtTap.runAction(cc.fadeOut(1));
            this.runDotLine();
            this.audioMng.playCarDriving();
            this.psCar1.active = true;
            this.psCar2.active = true;
            this.scheduleOnce(function() {
              this.Come_OBJ_1();
            }, .6);
            this.scheduleOnce(function() {
              this.Come_Seq_1();
            }, .6);
            this.scheduleOnce(function() {
              this.Come_OBJ_2();
            }, 1.2);
            this.scheduleOnce(function() {
              this.Come_Seq_2();
            }, 1.2);
          } else if (1 == this.ITEM_STEP) if (point.x <= 360) {
            if (true == this.Ptouch_1) {
              this.Ptouch_1 = false;
              this.audioMng.playSlide();
              if (0 == this.PYR_1) {
                this.PYR_1 = 1;
                this.spCar1.node.rotation = 20;
                this.spCar1.node.runAction(cc.moveTo(.3, cc.p(270, 200)));
              } else {
                this.PYR_1 = 0;
                this.spCar1.node.rotation = -20;
                this.spCar1.node.runAction(cc.moveTo(.3, cc.p(90, 200)));
              }
              this.scheduleOnce(function() {
                this.Plyr_Touch_1();
              }, .3);
            }
          } else if (true == this.Ptouch_2) {
            this.Ptouch_2 = false;
            this.audioMng.playSlide();
            if (0 == this.PYR_2) {
              this.PYR_2 = 1;
              this.spCar2.node.rotation = -20;
              this.spCar2.node.runAction(cc.moveTo(.3, cc.p(450, 200)));
            } else {
              this.PYR_2 = 0;
              this.spCar2.node.rotation = 20;
              this.spCar2.node.runAction(cc.moveTo(.3, cc.p(630, 200)));
            }
            this.scheduleOnce(function() {
              this.Plyr_Touch_2();
            }, .3);
          }
        },
        onTouchMove: function onTouchMove(event) {},
        onTouchEnd: function onTouchEnd(event) {},
        Plyr_Touch_1: function Plyr_Touch_1() {
          if (!this.IS_RUN) return;
          this.spCar1.node.rotation = 0;
          this.Ptouch_1 = true;
        },
        Plyr_Touch_2: function Plyr_Touch_2() {
          if (!this.IS_RUN) return;
          this.spCar2.node.rotation = 0;
          this.Ptouch_2 = true;
        },
        Come_OBJ_1: function Come_OBJ_1() {
          if (!this.IS_RUN) return;
          var actorBox = cc.instantiate(this.boxPrefab);
          var actor = actorBox.getComponent("actorBox");
          actor.initData({
            playerArea: 1,
            game: this,
            lineY: this.linePointY,
            carPYtop: this.carPYtop,
            carWidth: this.carWidth,
            car1: this.spCar1,
            car2: this.spCar2
          });
          this.layCtrl.node.addChild(actorBox);
        },
        Come_OBJ_2: function Come_OBJ_2() {
          if (!this.IS_RUN) return;
          var actorBox = cc.instantiate(this.boxPrefab);
          var actor = actorBox.getComponent("actorBox");
          actor.initData({
            playerArea: 2,
            game: this,
            lineY: this.linePointY,
            carPYtop: this.carPYtop,
            carWidth: this.carWidth,
            car1: this.spCar1,
            car2: this.spCar2
          });
          this.layCtrl.node.addChild(actorBox);
        },
        Come_Seq_1: function Come_Seq_1() {
          null == this.comeSeqHandle1 && (this.comeSeqHandle1 = function(dt) {
            this.Come_OnceSeq_1();
          });
          this.schedule(this.comeSeqHandle1, 1);
        },
        Come_Seq_2: function Come_Seq_2() {
          null == this.comeSeqHandle2 && (this.comeSeqHandle2 = function(dt) {
            this.Come_OnceSeq_2();
          });
          this.schedule(this.comeSeqHandle2, 1);
        },
        Come_OnceSeq_1: function Come_OnceSeq_1() {
          this.SCORE_TEMP <= 25 ? this.scheduleOnce(function() {
            this.Come_OBJ_1();
          }, .2) : this.SCORE_TEMP > 25 && this.SCORE_TEMP < 50 ? this.scheduleOnce(function() {
            this.Come_OBJ_1();
          }, .1) : this.scheduleOnce(function() {
            this.Come_OBJ_1();
          }, 0);
        },
        Come_OnceSeq_2: function Come_OnceSeq_2() {
          this.SCORE_TEMP <= 25 ? this.scheduleOnce(function() {
            this.Come_OBJ_2();
          }, .2) : this.SCORE_TEMP > 25 && this.SCORE_TEMP < 50 ? this.scheduleOnce(function() {
            this.Come_OBJ_2();
          }, .1) : this.scheduleOnce(function() {
            this.Come_OBJ_2();
          }, 0);
        },
        gameOver: function gameOver(boxPosition) {
          this.IS_RUN = false;
          cc.log("scenePlay---gameOver");
          this.audioMng.playCreck();
          var ps = cc.instantiate(this.psSquare);
          ps.setPosition(boxPosition);
          cc.director.getScene().addChild(ps);
          cc.director.loadScene("sceneGameOver");
        },
        addScore: function addScore(boxPosition) {
          cc.log("scenePlay---addScore");
          this.audioMng.playPickupCoin();
          var ps = cc.instantiate(this.psCircle);
          ps.setPosition(boxPosition);
          cc.director.getScene().addChild(ps);
          this.SCORE_TEMP = this.SCORE_TEMP + 1;
          global.currentScore = this.SCORE_TEMP;
          this.txtScore.string = this.SCORE_TEMP;
          var leve_hScore = global.getLevelHscore();
          if (leve_hScore < this.SCORE_TEMP) {
            leve_hScore = this.SCORE_TEMP;
            this.txtBest.string = leve_hScore;
            global.setLevelHscore(leve_hScore);
          }
        },
        stopSeqHandler: function stopSeqHandler() {
          if (null != this.comeSeqHandle1) {
            this.unschedule(this.comeSeqHandle1);
            this.comeSeqHandle1 = null;
          }
          if (null != this.comeSeqHandle2) {
            this.unschedule(this.comeSeqHandle2);
            this.comeSeqHandle2 = null;
          }
        },
        onDestroy: function onDestroy() {
          cc.log("scenePlay---onDestroy");
          this.stopSeqHandler();
          this.audioMng.stopBgMusic();
          this.audioMng.stopCarDriving();
        }
      });
      cc._RF.pop();
    }).call(this, "undefined" !== typeof global ? global : "undefined" !== typeof self ? self : "undefined" !== typeof window ? window : {});
  }, {
    actorBox: "actorBox"
  } ]
}, {}, [ "AudioMng", "actorBox", "buttonScaler", "global", "sceneGameOver", "sceneMenu", "scenePlay" ]);